GBML manual / Constants

EASE_BACK_OUT

Rushes to the end, runs a little past it and comes back - a move that overshoots and settles. The number goes about 10% past the end for a moment, so it leaves the range from the start to the end.

Syntax

EASE_BACK_OUT: constant

Description

The "back out" curve for tween and tween_to: it rushes to the end, runs a little too far, and comes back to settle on it. After a quarter of the time it is already at 0.82 of the way, after half it has gone past the end at 1.09, and after three quarters it is still a little past at 1.06.

The number leaves the range

Most curves keep the number between from and to. This one does not. For a moment the number goes about 10% of the distance past to: a number tweened to 100 from 0 reaches about 110 and then comes back to 100.

When the number is a position, that is the whole point: a menu that slides in and settles, a button that pops, a thing that lands with a little spring. When the number has to stay in a range it is a problem. A health bar that is tweened to full with this curve goes past full, and a volume goes past its loudest:

tween_to(hp, 0, 60, EASE_BACK_OUT);   // hp goes below 0 on the way: don't do this to a number with limits

A whole-number variable like hp would really read -10 for a moment. For a number that must stay between its two ends, use a sine or quad curve, or a bounce, which never goes outside them. It does arrive exactly: after the end the number is exactly to, every frame.

A real capture, 27 frames played in a loop - three small graphs, one above the other, labeled in, out and in out. In each one a ball moves steadily to the right while its height on the screen is the number being tweened: a dim dashed line at the top is where the number starts, a green dashed line below it is where it ends, and a trail of dots shows where the ball has been. In the out row the ball sinks a little past the green line and then comes back up onto it. In the in row it first rises a little above the dim line, the wrong way, and then sinks down to the green line. The in out row does both. The first frame, which is all a viewer that cannot animate shows, is the finished picture: every dot, drawing the whole of each curve.A real capture, 27 frames played in a loop - three small graphs, one above the other, labeled in, out and in out. In each one a ball moves steadily to the right while its height on the screen is the number being tweened: a dim dashed line at the top is where the number starts, a green dashed line below it is where it ends, and a trail of dots shows where the ball has been. In the out row the ball sinks a little past the green line and then comes back up onto it. In the in row it first rises a little above the dim line, the wrong way, and then sinks down to the green line. The in out row does both. The first frame, which is all a viewer that cannot animate shows, is the finished picture: every dot, drawing the whole of each curve.
A real capture, 27 frames played in a loop - three small graphs, one above the other, labeled in, out and in out. In each one a ball moves steadily to the right while its height on the screen is the number being tweened: a dim dashed line at the top is where the number starts, a green dashed line below it is where it ends, and a trail of dots shows where the ball has been. In the out row the ball sinks a little past the green line and then comes back up onto it. In the in row it first rises a little above the dim line, the wrong way, and then sinks down to the green line. The in out row does both. The first frame, which is all a viewer that cannot animate shows, is the finished picture: every dot, drawing the whole of each curve.

The same tween three ways, one row for each of EASE_BACK_IN, EASE_BACK_OUT and EASE_BACK_IN_OUT. The ball's height is the number (like tween_to(y, ...) moving something down), and it drifts right at a steady speed only so that the shape can be seen. The dim line is where the number starts and the green line is where it ends: look for the ball going past the green line, or behind the dim one. Real pictures from a Game Boy Advance ROM, 4 frames apart, played at the speed of the console. A viewer that does not animate shows the first picture, the finished one.

Example

tween_to(x, x + 100, 50, EASE_BACK_OUT);

The walker goes about 110 pixels to the right (10 too many), then comes back, and rests exactly 100 pixels from where it began.

The most useful of the three "back" curves: a menu that slides in a little too far and settles is one of the commonest ways to make a screen feel alive.

See also: tweentween_totween_from_to